﻿using System;

using DBUtility.PetaPoco;

namespace Model
{
    /// <summary>
    /// 已推送的消息
    /// </summary>
    [Serializable]
    [TableName("pushmessage")]
    [PrimaryKey("Id")]
    public partial class Pushmessage
    {
        #region Model
        private int _id;
		private string _messagecontent;
		private string _devtoken;
		private int? _appid;
		private DateTime? _sendtime;

        /// <summary>
		/// 主鍵
		/// </summary>
		public int Id
		{
		    set { _id = value; }
		    get { return _id; }
		}
		/// <summary>
		/// 推送內容
		/// </summary>
		public string MessageContent
		{
		    set { _messagecontent = (value == null || value.Length <= 500 ? value : value.Substring(0, 500)); }
		    get { return _messagecontent; }
		}
		/// <summary>
		/// 設備token
		/// </summary>
		public string Devtoken
		{
		    set { _devtoken = (value == null || value.Length <= 100 ? value : value.Substring(0, 100)); }
		    get { return _devtoken; }
		}
		/// <summary>
		/// 狀態(0=未推送，1=已推送)
		/// </summary>
		public int? AppId
		{
		    set { _appid = value; }
		    get { return _appid; }
		}
		/// <summary>
		/// 推送時間
		/// </summary>
		public DateTime? SendTime
		{
		    set { _sendtime = value; }
		    get { return _sendtime; }
		}
        #endregion
    }
}